package com.example.bookstore.service

import com.example.bookstore.dao.BookDao
import com.example.bookstore.entity.BookEntity
import com.example.bookstore.exception.ParamsValidateException
import org.springframework.stereotype.Service

/**
 * Created by IntelliJ IDEA.
 * User: lvshe
 * Date: 2019/8/10
 * Time: 15:10
 */
@Service
class BookService : BaseService<BookDao, BookEntity>() {

    fun getGuessYouLikeBook(number: Int): Set<BookEntity> {
        if (number <= 0) throw ParamsValidateException("number必须大于0")
        return dao.getRandomBooks(number)
    }

}